@import '@app/common.less';

.outputBox {
  overflow: hidden;
  background: #fff;
  position: relative;
  display: flex;
  flex-direction: column;
  margin: 20px 0;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);

  .outputHeader {
    padding: 12px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;

    .gql {
      flex: 1;
      display: inline-block;
      margin: 0;
      background: #00bfa54d;
      border-radius: 6px;
      padding: 11px 14px;
      cursor: pointer;
      font-family: Roboto-Regular, sans-serif;
      font-weight: 500;
      font-size: 18px;
      color: #00bfa5;
    }

    .gqlValue {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: pre-wrap;
      display: -webkit-box;
      -webkit-line-clamp: 3;
      -webkit-box-orient: vertical;
      word-break: break-all;
    }

    .errorInfo {
      background-color: #d32f2f4d;
      color: #d32f2f;
    }

    .outputOperations {
      display: flex;
      align-items: center;
      margin-left: 22px;

      > :global(span.anticon) {
        cursor: pointer;

        svg {
          color: @darkBlue;
          width: 22px;
          height: 22px;
        }

        &:not(:last-child) {
          margin-right: 22px;
        }

        &.btnYellow svg {
          color: #f2c94c;
        }
      }

      .btnExport {
        cursor: pointer;
      }
    }
  }

  :global(.ant-table) {
    overflow: auto;
  }

  .tabContainer {
    position: relative;
    border-top: 1px solid #e0e0e0;
    flex: 1;
    white-space: pre;
    overflow: auto;

    .outputTab {
      height: 300px;

      &> :global(.ant-tabs-nav) {
        width: 80px;
        height: 100%;

        :global {
          .ant-tabs-tab {
            padding: 0;
            height: 80px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-top: 0;

            .ant-tabs-tab-btn {
              display: flex;
              flex-direction: column;
              align-items: center;
              justify-content: center;

              .anticon {
                margin-right: 0;

                svg {
                  width: 22px;
                  height: 22px;
                }
              }
            }

            &.ant-tabs-tab-active {
              background: #0d8bff;

              .ant-tabs-tab-btn {
                color: #fff;
              }
            }
          }
        }
      }

      &> :global(.ant-tabs-content-holder) {
        position: relative;
        background-color: #fff;
        overflow: auto;

        :global {
          .ant-tabs-content {
            height: 100%;

            .ant-table,
            .ant-pagination {
              margin: 20px;
            }

            .ant-tabs-tabpane {
              padding-left: 0;
              position: relative;
              background-color: @lightBlue;
              overflow: auto;
              height: 100%;
            }
          }
        }
      }

      .errContainer {
        padding: 20px;
        color: #d32f2f;
      }
    }

    table {
      background: #f8f8fa;
      width: 100%;

      thead>tr>th {
        background: @lightGray;
        font-weight: 500;
      }
    }
  }

  .outputFooter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 18px;
    width: 100%;
    height: 65px;
    border-top: 1px solid #e0e0e0;
    font-family: Roboto-Regular, sans-serif;
    font-size: 16px;
    color: @darkBlue;
    letter-spacing: 1.48px;

    .btns {
      display: flex;
      align-items: center;

      svg {
        width: 24px;
        height: 24px;
      }

      button:not(:last-child) {
        margin-right: 10px;
      }
    }

    .resizeBtn {
      position: absolute;
      bottom: 6px;
      right: 10px;
      cursor: ns-resize;
      transition: none;
      color: rgba(0, 0, 0, 0.2);
    }
  }
}

.exportPopover {
  :global(.ant-popover-content > .ant-popover-inner) {
    padding: 4px 0;
    border-radius: 3px;
  }

  .downloadItem {
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: black;
    font-weight: 400;
    font-size: 12px;

    &[disabled] {
      color: rgba(0, 0, 0, 0.25);
    }
  }
}

.fullscreen {
  position: fixed;
  z-index: 888;
  width: 100vw;
  height: calc(100vh - 60px);
  left: 0;
  top: 60px;
  margin: 0;

  .tabContainer .outputTab {
    height: 100%;
  }
}